import { createApp } from "vue";
import lazyPlugin from "vue3-lazy";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import installElementPlus from "./plugins/element";
import { useRouter, useRoute } from "vue-router";
import { ElMessage, ElMessageBox, ElLoading } from "element-plus";
import { EcoAccountFormSubmission, getCalculateList } from "./assets/js/common";
import "./assets/css/icon.css";
import { useStore } from "vuex";
import * as echarts from "echarts";
const app = createApp(App);
installElementPlus(app);
app.config.globalProperties.$echarts = echarts;
app.config.globalProperties.$router = useRouter();
app.config.globalProperties.$route = useRoute();
app.config.globalProperties.$ElMessage = ElMessage;
app.config.globalProperties.$ElMessageBox = ElMessageBox;
app.config.globalProperties.$ElLoading = ElLoading;
app.config.globalProperties.$EcoAccountFormSubmission = EcoAccountFormSubmission;
app.config.globalProperties.$getCalculateList = getCalculateList;
app.config.globalProperties.$store = useStore();
app
  .use(store)
  .use(router)
  .use(lazyPlugin, {
    loading: "", // 图片加载时默认图片
    error: "", // 图片加载失败时默认图片
  })
  .mount("#app");
